package com.example.springmvcdemo.mapper;

import com.example.springmvcdemo.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/*
 * @author zzr
 * @date: 2025/09/22  19:12
 * @description:
 */

@Mapper
public interface MessageInfoMapper {

    @Insert("insert into message_info (`from`,`to`,`message`) values " +
            "(#{from},#{to},#{message})")
    public Integer addMessage(MessageInfo messageInfo);


    @Select("select `id`, `from`,`to`,message from message_info where delete_flag = 0")
    public List<MessageInfo> queryAll();
}
